home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXT Education Software Sampler 1992 Fall
/
NeXT Education Software Sampler 1992 Fall.iso
/
SoundAndMusic
/
cmix
/
lib
/
brrand.c
< prev
next >
Wrap
Text File
|
1989-02-25
|
351b
|
22 lines
/* block version of rrand */
/* a modification of unix rand() to return floating point values between
+ and - 1. */
static long randx = 1;
sbrrand(x)
unsigned x;
{
randx = x;
}
brrand(amp,a,j)
float amp,*a;
{
int k;
for(k=0; k<j; k++) {
int i = ((randx = randx*1103515245 + 12345)>>16) & 077777;
*a++ = amp * ((float)i/16384. - 1.);
}
}